<?php include(dirname(__FILE__) . "/functions.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
  <meta http-equiv="Expires" content="Tue, 01 Jan 2000 12:12:12 GMT">
  <meta http-equiv="Pragma" content="no-cache">
  <title>ThemeFrame RC1c</title>
  <link rel="shortcut icon" href="/favicon.ico"/>
  <link rel="stylesheet" href="<?php echo THFRURL . 'css/jquery-ui-1.8.11.custom.css'; ?>" type="text/css" media="all"/>
  <link rel="stylesheet" href="<?php echo THFRURL . 'javascript/jPicker-1.1.6/jPicker.css'; ?>" type="text/css" media="all"/>
  <link rel="stylesheet" href="<?php echo THFRURL . 'javascript/jPicker-1.1.6/css/jPicker-1.1.6.css'; ?>" type="text/css" media="all"/>
  <link rel="stylesheet" href="<?php echo THFRURL . 'css/themeframe.css'; ?>" type="text/css" media="all"/>
  <!--<link rel="stylesheet" href="<?php echo THFRURL . 'javascript/CodeMirror-2.16/lib/codemirror.css'; ?>" />-->
  <!--<link rel="stylesheet" href="<?php echo THFRURL . 'javascript/CodeMirror-2.16/theme/default.css'; ?>" />-->
  <script type="text/javascript">
    var THFRURL = '<?php echo THFRURL; ?>';
    var THFRPATH = '<?php echo urlencode(THFRPATH); ?>';
    var THFRUPLOADPATH = '<?php echo urlencode(THFRUPLOADPATH); ?>';
    var RELATIVETHFRUPLOADURL = '<?php echo RELATIVETHFRUPLOADURL; ?>';

    <?php foreach (array(
      'jquery-1.5.1.min.js',
      'jquery-ui-1.8.11.custom.min.js',
      'jpicker-1.1.6/jpicker-1.1.6.js',
      'ajaxupload.js',
      'jquery.fileTree.js',
      'globalVariables.js',
      'centerinViewport.js',
      'applySidebars.js',
      'translateBorderRadius.js',
      'translateBoxShadow.js',
      'createCssObject.js',
      'applyStyles.js',
//  'CodeMirror-2.16/lib/codemirror.js',
//  'CodeMirror-2.16/mode/php/php.js',
      'autoresize.jquery.js',
      'themeframe.js'
    ) as $jsfile) {
      include(dirname(__FILE__) . "/javascript/" . $jsfile);
      echo "\n\n";
    }
    ?>
    //var myCodeMirror = CodeMirror(document.body);
  </script>
  <?php // Get current selector if available
  $cur_sel = (!isset($thfr_css['tfcssselector']) ? "div#wrapper" : $thfr_css['tfcssselector']);
  $cur_group = (!isset($thfr_css['selectorgroup']) ? 'index' : $thfr_css['selectorgroup']);
  ?>
</head>
<body>

<div id="masthead">
  <a id="logo" href="<?php echo htmlspecialchars($_SERVER['REQUEST_URI']) ?>"></a>
  <a href="#" class="topbuttons" id="downloadzip">Get<br/>ZIP</a>
  <a href="#" class="topbuttons" id="downloadfiles">Get<br/>Files</a>
  <a href="#" class="topbuttons" id="ftptransfer">FTP<br/>Transf.</a></li>
  <a href="#" class="topbuttons" id="exportdialog">Export<br/>Theme</a>
  <a href="#" class="topbuttons" id="importdialog">Import<br/>Theme</a>
  <a href="#" class="topbuttons" id="debugoutput">View<br/><span style="margin-left:-3px;letter-spacing:0px">Settings</span></a>
  <a href="#" class="topbuttons" id="undo-all">Undo<br/>All</a>
  <a href="#" class="topbuttons" id="undo">Undo<br/>One</a>
  <a href="#" class="topbuttons" id="redo">Redo<br/>One</a>
  <a href="#" class="topbuttons" id="redo-all">Redo<br/>All</a>
  <a href="#" class="topbuttons" id="history-view">View<br/>History</a>
  <a href="#" class="topbuttons" id="history-clear-dialog">Clear<br/>History</a>

  <div style="float:right;border:solid 1px #777;color:#ddd;font-size:12px;margin: 5px 10px 0 0;padding:2px;">
    Current History Position:
    <div id="curhistpos">
      <?php $pos = get_curpos(); ?>
      Node <strong><?php echo $pos['node']; ?></strong> -
      Branch <strong><?php echo $pos['branch']; ?></strong> -
      Step <strong><?php echo $pos['step']; ?></strong>
    </div>
  </div>
</div>

<div id="resetsuccess" style="display:none;background:yellow;padding:5px"></div>

<div id="themeframe-form"></div>

<div id="tfleftmenu">


  <h3 id="global-settings" class="menutitle" style="padding-top:15px">Edit <i>Global Settings</i></h3>
  <ul class="clearfix preview-tabs" id="global-settings-menu">
    <li><a class="themeinfo">Theme Info</a></li>
    <li><a class="layoutwidth">Layout Widths</a></li>
    <li><a class="headerimages">Header Images</a></li>
  </ul>

  <h3 id="edit-content" class="menutitle">Edit <i>Content Options</i></h3>
  <ul class="clearfix preview-tabs" id="edit-content-menu">
    <li><a class="multipagetitles">Multi-Post-Page Titles</a></li>
    <li><a class="nextprevnav">Next/Prev. Navigation</a></li>
    <li><a class="excerpts">Automatic Excerpts</a></li>
    <li><a class="footercontent">Footer Content</a></li>
  </ul>

  <h3 id="global-styles" class="menutitle">Style <i>Typography</i></h3>
  <ul class="clearfix preview-tabs" id="global-styles-menu">
    <li><a class="text">Text</a></li>
    <!--
    <li><a class="tf-preview-headings headings">Headings</a></li>
    <li><a class="tf-preview-paragraphs paragraphs">Paragraphs</a></li>
    <li><a class="tf-preview-links links">Links</a></li>
    -->
    <li><a class="images">Images</a></li>
    <li><a class="lists">Lists</a></li>
    <li><a class="tables">Tables</a></li>
    <li><a class="blockquotes">Blockquotes</a></li>
  </ul>
  <h3 id="page-templates" class="menutitle">Style &amp; Layout <i>Page Templates</i></h3>
  <ul class="clearfix preview-tabs" id="page-templates-menu">
    <?php foreach ($thfr_css['pagetemplates'] as $value) {
    ; ?>
    <li id="li-<?php echo $value; ?>"><!-- used to target item when deleted -->
      <a class="<?php echo $value; ?>"><strong><?php echo $value; ?></strong>.php
        <?php if ($value != 'index') { ?>
          <span title="Delete <?php echo $value; ?>.php" class="delpagetpl" id="del-<?php echo $value; ?>"></span>
          <?php } ?>
      </a>
    </li>
    <?php } ?>

    <p id="addtemplatelink" style="padding:0;margin:0"><a href="#" id="addpagetemplate">ADD TEMPLATE</a></p>
    <!-- <li id="addtemplatelink"><a id="addpagetemplate">ADD TEMPLATE</a></li> -->
  </ul>
  <h3 id="post-containers" class="menutitle">Edit <i>Post Containers</i></h3>
  <ul class="clearfix preview-tabs" id="post-containers-menu">
    <?php foreach ($thfr_css['postcontainers'] as $name => $value) {
    ; ?>
    <li><a class="postcontainers <?php echo $name; ?>"><?php echo $name; ?></a></li>
    <?php } ?>
  </ul>
  <h3 id="menu-bars" class="menutitle">Style <i>Menu Bars</i></h3>
  <ul class="clearfix preview-tabs" id="menu-bars-menu">
    <li><a class="hormenu">Menu 1<br/></a></li>
    <li><a class="hormenu2">Menu 2<br/></a></li>
  </ul>
  <!--
    <h3 id="slide-shows" class="menutitle">Slideshows</h3>
    <ul class="clearfix preview-tabs" id="slide-shows-menu">
      <li class="tf-preview-crossslide"><a class="tf-preview-crossslide crossslide">CrossSlide</a></li>
      <li class="tf-preview-cycle"><a class="tf-preview-cycle cycle">Cycle</a></li>
    </ul>
  -->


  <h3 id="comment-templates" class="menutitle">Style &amp; Edit <i>Comment Section</i></h3>
  <ul class="clearfix preview-tabs" id="comment-sections-menu">
    <li><a class="comments">comments.php</a></li>
    <li><a class="commenttext">Comment Section Text Bits</a></li>
  </ul>

  <h3 id="code-inserts" class="menutitle">Advanced Usage: <i>Code Inserts</i></h3>
  <ul class="clearfix preview-tabs" id="code-inserts-menu">
    <li><a class="custompage head">Page Templates &rarr; HEAD</a></li>
    <li><a class="custompage bodytag">Page Templates &rarr; BODY TAG</a></li>
    <li><a class="custompage bodytop">Page Templates &rarr; BODY TOP</a></li>
    <li><a class="custompage bodybottom">Page Templates &rarr; BODY BOTTOM</a></li>
    <li><a class="customcss">style.css</a></li>
    <li><a class="customjs">javascript.js</a></li>
    <li><a class="customphp">functions.php</a></li>
  </ul>
</div>

<!-- PREVIEW AREA STARTS HERE -->
<div id="tf-preview">
  <img src="<?php echo THFRURL; ?>images/defaultimg.png" style="margin: 30px 0 0 30px">
</div>
<!-- tf-preview -->
<!-- / PREVIEW -->

</body>
</html>